import http from '@/common/js/httpRequest'
//渲染菜单用
export function getMenuList () {
  return http({
    method: 'get',
    url: '/api/sys/menu/list'
  })
}
//配置角色用
export function getAllMenuList () {
  return http({
    method: 'get',
    url: '/api/sys/menu/list/all'
  })
}
//配置角色用
export function getPermIdListByRoleId (id) {
  return http({
    method: 'get',
    url: `/api/sys/menu/permids?roleId=${id}`
  })
}

//添加一个菜单
export function addMenu (data) {
  return http({
    method: 'post',
    url: '/api/sys/menu/add',
    data: data
  })
}

//删除一个菜单项
export function delMenu (menuId) {
  return http({
    method: 'get',
    url: '/api/sys/menu/del/'+ menuId
  })
}